package com.jingwei.controller;

import com.alibaba.fastjson.JSON;
import com.jingwei.service.PermissionService;
import com.jingwei.service.RoleService;
import com.jingwei.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 经纬
 * @since 2024/12/18 11:09
 */
@RestController
@RequestMapping("/staff")
@RequiredArgsConstructor
public class StaffController {
    private final UserService userService;
    private final RoleService ruleService;
    private final PermissionService permissionService;


    @GetMapping("/userList")
    public String userList() {
        return JSON.toJSONString(userService.list());
    }

    @GetMapping("/roleList")
    public String roleList() {
        return JSON.toJSONString(ruleService.list());
    }

    @GetMapping("/permissionList")
    public String permissionList() {
        return JSON.toJSONString(permissionService.list());
    }

}
